This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
- I managed to get it to present the dialog, using either "plain" markup (as the page you refer to, which I used as a model), or using <xp:..> automagic markup (using the xpagesblog sample as a model). But it won't run any server-side actions, ie, <saveDocument> won't work. Or it does work. One time and one time only. Here's the scenario:
1. User clicks button.
2. Buttons presents dialog.
3. User enters data, selects from a drop down, etc. In this instance I'm confining myself to one text area and one text area only.
4. If user accepts, put data in a known field and save the document. This runs postSaveDocument, which runs an Agent, which runs piles of legacy code based on the value of the known field.
5. If the Agent indicates success, we're done. One save is all we need.
6. If the Agent indicates failure, reload the current page with a message in panel. At this point the user could do any number of things, including return to step 1.
Whatever the user does, after step 6, they will most likely save the document a second time, which should trigger postSaveDocument a second time, which should run the legacy code a second time. But it doesn't. After the first invocation, postSaveDocument will not run again on that page, until it's completely unloaded (as in navigate to another page entirely) and reloaded. Then it will run postSaveDocument once, until the next reload, and so on.
- I changed it to use the <xp:...> automagic markup so I could move the <xp:saveDocument /> action into the dialog itself, instead of attempting to pass a value back from the dialog to tell the invoking button whether to continue or not. This is how it's done on the xpagesblog site sample, and it seemed like it should be less hassle to do it that way. Alas that did nothing at all ... under no circumstances would it trigger or run any code, client or server side, under the <xp:eventHandler> tag directly on the dialog. Ever.
- To get it to run a save at all I had to use the xpagesblog trick of running a server-side event from client side code. A "simple" <xp:saveDocument /> on the dojo dialog button simply would never trigger.
- This thread:( ) is similar to the current one, but contains different information, including relatively current source. The primary difference between that source and what I have now is that the "Add Comment" button does not have an <xp:eventHandler>, it has onclick="dlgWFNSubmit()", and it runs the following client-side code:
function dlgWFNSubmit() {
var xpAct=dojo.byId("#{id:xpAction}");
xpAct.value="WFN:"+dojo.byId("#{id:dlgWFComment}").value+"]";
dijit.byId('#{id:dlgWFNote}').hide();
executeOnServer("saveOnly");
alert("Ran: \""+xpAct.value+"\"");
return true;
}
The "executeOnServer()" function is a literal cut and paste from here:
So I still don't see how what is supposed to be trivially simple functionality can go so horriby awry. If you could theorize on that I'd be happy to hear what you come up with.
Feedback response number DGIE86WR6F created by ~Holly Zekhipisonnivu on 06/30/2010